Various fixes and improvements to hash2curve #1813
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was mainly to fix a bug in handling large DSTs for
expand_message_xof
.ExpandMsg::expand_message()
slen_in_bytes
parameter is now aNonZero
, moving one run-time error to the type system.FromOkm::Length
now requirestypenum::NonZero
.K
parameter toExpandMsg
implementers.ExpandMsgXmd
only uses it to follow constraints set by the specification more closely. See https://www.rfc-editor.org/rfc/rfc9380.html#section-5.3.1-2.1.ExpandMsgXof
, requiresK
to calculate the size for the computed DST if the given DST is larger than 255 bytes. This was previously not implemented correctly in that it always used a 32-byte long computed DST.type K
to theGroupDigest
trait. This allows blanket implementations to use the rightK
forExpandMsgXmd
andExpandMsgXof
.HashMarker
to the constraints ofHashT
forExpandMsgXof
.ExpandMsg
trait implementations to the actual type and added links to the specification.Cc @mikelodder7.